package se.webbzon.oschi01.gui;

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;

public class LoadingFrame extends JFrame {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8750636298264073148L;

	private final JLabel label;
	
	private final JProgressBar progressBar;
	
	public LoadingFrame(String message) {
		this("Loading...",message);
	}
	
	public LoadingFrame(String title, String message) {
		getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.Y_AXIS));
		label = new JLabel(message);
		add(label);
		
		progressBar = new JProgressBar();
		progressBar.setValue(0);
		add(progressBar);
		
		pack();
	}
	
	public int getValue() {
		return progressBar.getValue();
	}
	
	public void setValue(int value) {
		progressBar.setValue(value);
	}

}
